'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
    // 往admins表中添加数据
    async up(queryInterface, Sequelize) {
        await queryInterface.bulkInsert('Admins', [{
            admin_name: 'admin',
            // 密码进行sha1加密，加密后的字符串是40位
            admin_password: require('sha1')('123456'),
            createdAt: new Date(),
            updatedAt: new Date()
        }], {});

    },

    async down(queryInterface, Sequelize) {
        // 清空表中的数据
        await queryInterface.bulkDelete('Admins', null, {});
    }
};